package com.sny.upgrade.util;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * Created by tyler.tang on 2017/6/7.
 */

public class UpgradeUtil {


    /**
     * 跳转到Google市场
     *
     * @param context 上下文
     */
    public static void forwardToGp(Context context) {

        String packageName = context.getPackageName();

        Uri uri = Uri.parse("market://details?id=" + packageName);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        intent.setPackage("com.android.vending");

        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

        context.startActivity(intent);

    }
}
